<template>
  <div class="navContainer">
    <span>ToDoList</span>
    <input type="text"placeholder="添加ToDo" v-model="content" @keydown.enter="addNewThing">
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { useThingsStore } from '../store/thingsStore';
const content = ref('')
const thingsStore = useThingsStore()
async function addNewThing() {
  thingsStore.addList(content.value,1)
  content.value = ''
}
</script>

<style scoped> 
  .navContainer {
    width: 100%;
    background-color: #333333;
    height: 50px;
    line-height: 50px;
    /* padding: 0 50px; */
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 22px;
  }
  input {
    display: inline-block;
    height: 30px;
    width: 60%;
    border-radius: 8px;
    background-color: white;
    color: black;
  }
</style>